<!-- 月工作计划 planMonthList.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/ext3/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/ext3/ext-all.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/ext3/resources/css/ext-all.css">
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '增加',
				            icon:"<%=contextPath%>/images/add.gif",
				            handler:function(){
				            	toDetail('0')				            	
				            },
				            hidden:<%= !"".equals(request.getAttribute("bz")) ? false:true%>
				        },'-',
				        {
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt,
				            hidden:<%= "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			
			<hr>
			<table width="100%" id="listtab">
				<tr>
					<th width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</th>
					<th>工作计划月份</th>
				</tr>
				<c:forEach items="${list}" var="detail" >
					<tr>
						<td  width="25">
							<input type="checkbox" name="id" value="${detail.planmonth}" />
						</td>
						<td>
							<a href="#" onClick="javascript:toDetail('<c:out value="${detail.planmonth}"/>')" >
								<c:out value="${detail.planmonth}"/>
							</a>
						</td>
					</tr>
				</c:forEach>
				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="7" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		</div>
	</body>
</html>
<script language="javascript">

			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/planMonthList!getList.do?page=1&c=c";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(ym){
				document.frmM.action = "<%=contextPath%>/planMonth!initDetail.do?ym=" + ym;
				uncheck("id");
				document.frmM.submit();
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/planMonth!delete.do";
					document.frmM.submit();
		    	}
			}
			
		</script>